Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gradle-plugin): architecture folder name missmatch when using SPM and framework path searching #320

Merged
merged 34 commits into from
Feb 10, 2025

Conversation

buenaflor
Copy link
Contributor

@buenaflor buenaflor commented Jan 30, 2025

📜 Description

Fixes several things

  • not finding the correct architecture in newer cocoa versions xcframeworks
  • frameworkPath doesn't check for architecture folders
  • add multiple strategies for finding the cocoa framework path when using SPM, if one fails to find it, the next one is triggered:
      1. custom framework path set by user frameworkPath
      1. derived data using the xcodeproj with xcodebuild -showBuildSettings
      1. searching derived data manually using commands

💡 Motivation and Context

Right now 8.38.0 and above won't work with the plugin with SPM

💚 How did you test it?

Added test that downloads the frameworks and tests against it.

📝 Checklist

You have to check all boxes before merging:

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.

🔮 Next steps

Copy link

codecov bot commented Jan 30, 2025

Codecov Report

Attention: Patch coverage is 76.72414% with 54 lines in your changes missing coverage. Please review.

Project coverage is 80.20%. Comparing base (d3bf403) to head (c0fbf16).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...tlin/multiplatform/gradle/FrameworkPathResolver.kt 86.72% 8 Missing and 7 partials ⚠️
...sentry/kotlin/multiplatform/gradle/SentryPlugin.kt 25.00% 10 Missing and 5 partials ⚠️
...try/kotlin/multiplatform/gradle/FrameworkLinker.kt 52.38% 6 Missing and 4 partials ⚠️
...orm/gradle/ManualFrameworkPathSearchValueSource.kt 71.42% 5 Missing and 3 partials ⚠️
...otlin/multiplatform/gradle/CocoaFrameworkLinker.kt 89.36% 3 Missing and 2 partials ⚠️
...multiplatform/gradle/DerivedDataPathValueSource.kt 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #320      +/-   ##
==========================================
+ Coverage   77.00%   80.20%   +3.19%     
==========================================
  Files          39       43       +4     
  Lines         635      793     +158     
  Branches       86      105      +19     
==========================================
+ Hits          489      636     +147     
- Misses        100      103       +3     
- Partials       46       54       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@buenaflor buenaflor changed the title fix(gradle-plugin): architecture folder name missmatch when using SPM fix(gradle-plugin): architecture folder name missmatch when using SPM and framework path searching Jan 31, 2025
@buenaflor buenaflor marked this pull request as ready for review February 6, 2025 12:37
@buenaflor buenaflor requested a review from romtsn as a code owner February 6, 2025 12:37
Copy link
Member

@romtsn romtsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is very well done, hats off!

I really like how you split the search up into different strategies. The use of parameterized tests is :chefkiss: and also the fact that you're downloading a real xcframework from github is making a perfect integration test!

Just left a few minor comments, but nothing big apart from handling exitValue maybe.

@buenaflor buenaflor enabled auto-merge (squash) February 10, 2025 15:56
@buenaflor buenaflor merged commit 1279a73 into main Feb 10, 2025
10 of 11 checks passed
@buenaflor buenaflor deleted the fix/arch-names branch February 10, 2025 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants